package com.hdoit.ares.web.share.controllers;

import com.hdoit.ares.logical.official.model.Artical;
import com.hdoit.ares.logical.official.service.IArticalService;
import com.tennetcn.component.web.BaseController;
import com.tennetcn.web.cbase.AuthPassport;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

@Controller
@RequestMapping(value="/admin/share/share/")
@AuthPassport
public class ShareController extends BaseController {

    @Override
    public String getRoutePath() {
        return "areas/admin/share/share/";
    }

    private IArticalService articalService;
    public IArticalService getArticalService() {
        return articalService;
    }
    @Resource
    public void setArticalService(IArticalService articalService) {
        this.articalService = articalService;
    }
    private final String articalDetailViewName="articalDetail";


    @RequestMapping(value = articalDetailViewName, method = { RequestMethod.GET,RequestMethod.POST })
    public String articalDetail(Model model,String id){

        Artical artical = articalService.queryModel(id);

        model.addAttribute("artical", artical);
        return view(articalDetailViewName);

    }
}
